﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="TCGWeb._Default" %>
<%@ Import Namespace="TCG" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
    $(document).ready(function () {
        $(".card").click(
            function () {
                logLN('Card Click: ' + this.attributes['cardid'].value);
            }
        )
    });

    function logLN(s)
    {
        var logWin = $('.logWin');
        logWin.html(s+'<br />'+logWin.html());
    }

    function alertmsg() {
        alert('You have no resource to throw this card!');
        return false;
    }
</script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
   
   <div class="Player">
     Name: <%= ThreadInteraction.TCGMatch.Player1.Name %><br />
     Health: <%= ThreadInteraction.TCGMatch.Player1.Life %><br />
     
     Gold: <%= ThreadInteraction.TCGMatch.Player1.Gold %><br />
     Mana: <%= ThreadInteraction.TCGMatch.Player1.Mana %><br />

   </div>

   <div class="workArea">Last Turn

   <asp:Label runat="server" ID="lblGameResult"></asp:Label>
    <%--   <asp:Repeater ID="rptLT" runat="server">
            <ItemTemplate>
                <div class="card" >
                    <div class="caption"><%# Eval("Name") %></div>
                    <img alt='<%# Eval("Name") %>' src='Images/<%# Eval("ImagePath") %>' />
                    <div class="descript"><%# Eval("Description")%></div>
                    <div class="resCost"><%# ((ResourceCount)Eval("Cost")).First().Value %></div>
                </div>
            </ItemTemplate>
        </asp:Repeater>--%>
   </div>

   <div class="Player">
     Name: <%= ThreadInteraction.TCGMatch.Player2.Name %><br />
     Health: <%= ThreadInteraction.TCGMatch.Player2.Life %><br />

     Gold: <%= ThreadInteraction.TCGMatch.Player2.Gold %><br />
     Mana: <%= ThreadInteraction.TCGMatch.Player2.Mana %><br />

   </div>
   <div class="clrboth"></div>

   <div class="Cards">
        <h2 class="plTurn">
            <%= ThreadInteraction.TCGMatch.ActivePlayer.Name %> Turn
        </h2>
        <asp:Repeater ID="rptCards" runat="server">
            <ItemTemplate>
                <asp:LinkButton ID="lbtCard" runat="server" CommandArgument='<%# ((TCG.Engine.Libraries.CardInfo)Eval("Info")).Id  %>' OnCommand="lbtCard_Command">
                <div class="card">
                <div>
                    <div class="caption"><%# ((TCG.Engine.Libraries.CardInfo)Eval("Info")).Title %></div>
                    <img alt='<%# ((TCG.Engine.Libraries.CardInfo)Eval("Info")).Title %>' src='/Images/Cards/<%# ((TCG.Engine.Libraries.CardInfo)Eval("Info")).Image %>' />
                    <div class="descript"><%# ((TCG.Engine.Libraries.CardInfo)Eval("Info")).Description %></div>
                    <div class="resCost">Gold: <%# ((TCG.Engine.Libraries.CardInfo)Eval("Info")).CostGold %></div>
                    <div class="resCost">Mana: <%# ((TCG.Engine.Libraries.CardInfo)Eval("Info")).CostMana %></div>
                </div></div>
                </asp:LinkButton>
            </ItemTemplate>
        </asp:Repeater>
        <div class="clrboth"></div>
   </div>
   <asp:Button runat="server" ID="btnEndTurn" OnClick="btnEndTurn_Click" Text="End Turn"/>
    <div class="logWin"><%=LogLines %></div>
</asp:Content>
